package com.itheima.mapper.sms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.vo.pojo.SmsFlashPromotionSession;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SmsFlashPromotionSessionMapper extends BaseMapper<SmsFlashPromotionSession> {

    //修改场次的状态
    @Update("<script> " +
            "update sms_flash_promotion_session set " +
            "<if test='name!=null'> name = #{name},</if>" +
            "<if test='startTime!=null'> startTime=#{startTime} ,</if>\n" +
            "<if test='endTime!=null'> endTime=#{endTime} ,</if>\n" +
            "<if test='status!=null'> status=#{status}, </if>" +
            "<if test='createTime!=null'> createTime=#{createTime},</if> " +
            "id = #{id} where id = #{id} " +
            "</script>")
    void updateStatus(SmsFlashPromotionSession smsFlashPromotionSession);

}
